get taxonomy term id from slug - WordPress

58

get taxonomy term id from slug - WordPress -

<?php 
    $term = get_term_by('slug', $slug, 'category'); 
    $name = $term->name; 
    $id = $term->term_id;
?>

Comments

Submit
0 Comments